package com.dzpk.gameserver.enumeration;

import java.util.HashMap;
import java.util.Map;

public enum RoleAttrEnum {
    BLOOD(10, 0, 1),
    MENTALITY(30, 2, 1),
    PARRY(160, 15, 3),
    COMMON_FIGHT(50, 4, 2),
    R_COMMON_DEFENCE(1060, 5, 2),
    COMMON_DEFENCE(60, 5, 2),
    R_MENTALITY(1030, 2, 1),
    R_CD(3030, 19, 3),
    SORCERY_FIGHT(70, 6, 2),
    R_COMMON_FIGHT(1050, 4, 2),
    TRICK_DEFENCE(100, 9, 2),
    HIT(110, 10, 3),
    R_ENERGY(3020, 18, 3),
    DODGE(120, 11, 3),
    R_TRICK(1040, 3, 1),
    CRIT(130, 12, 3),
    TOUGHNESS(140, 13, 3),
    SUNDER_ARMOR(150, 14, 3),
    GOLD(2000, 16, 3),
    EXP(2010, 17, 3),
    ENERGY(2020, 18, 3),
    POWER(20, 1, 1),
    CD(2030, 19, 3),
    DAMAGE(170, 20, 3),
    R_BLOOD(1010, 0, 1),
    R_POWER(1020, 1, 1),
    R_SORCERY_FIGHT(1070, 6, 2),
    R_SORCERY_DEFENCE(1080, 7, 2),
    TRICK(40, 3, 1),
    R_TRICK_FIGHT(1090, 8, 2),
    R_TRICK_DEFENCE(1100, 9, 2),
    R_GOLD(3000, 16, 3),
    TRICK_FIGHT(90, 8, 2),
    R_EXP(3010, 17, 3),
    R_DAMAGE(1170, 20, 3),
    SORCERY_DEFENCE(80, 7, 2),
    SKILLFRESH(2040, 21, 3),
    R_EXPLOIT(3040, 22, 3);

    private int id;

    private int grade;

    private int order;

    public static RoleAttrEnum getEnum(int id) {
        return enumMap.get(id);
    }

    private static Map<Integer, RoleAttrEnum> enumMap;

    static {
        enumMap = new HashMap<Integer, RoleAttrEnum>(0);
        for (RoleAttrEnum a : RoleAttrEnum.values()) {
            enumMap.put(a.id, a);
        }

    }

    public int getGrade() {
        return grade;
    }

    public int getOrder() {
        return order;
    }

    public void setOrder(int order) {
        this.order = order;
    }

    public boolean checkId() {
        if ((id >= 10 && id < 1000) || (id >= 2000 && id < 3000)) {
            return true;
        } else {
            return false;
        }
    }

    public int getId() {
        return id;
    }

    RoleAttrEnum(int id, int order, int grade) {
        this.id = id;
        this.order = order;
        this.grade = grade;
    }

    public void setId(int id) {
        this.id = id;
    }

    public void setGrade(int grade) {
        this.grade = grade;
    }
}
